var Auth_Adapter_Redis = function(config){
  this.redisClient = require('redis').createClient();
  this.nohm = config.nohmClient;
  this.nohm.setClient(this.redisClient);
}

/**
 * @param String username the username to authenticate
 * @param String password the password for the user
 * @param function callback this will be called when authication is done. contains "err"-object as first parameter if an error occured
 */
Auth_Adapter_Redis.prototype.authenticate = function(user, pass, callback){
  var UserModel = require('../../../models/User');
  var user = new UserModel;
  
  user.find(function(ids){
    console.dir(ids);
    if(ids.length < 1){
      var err = new Array;
      err.push("Wrong user/password combination");
    }
    callback(ids, err);
  });
}

module.exports = Auth_Adapter_Redis;